import sympy as sp

# 定义符号变量
x = sp.Symbol('x')

# 定义被积函数
f = 2*x**3 - 3*sp.cos(x) + 4/x

# 计算不定积分
result = sp.integrate(f, x)
print(f"不定积分结果：{result} + C")

# 验证结果：对积分结果求导
derivative_check = sp.diff(result, x)
print(f"验证导数：{derivative_check}")
print(f"验证通过：{sp.simplify(derivative_check - f) == 0}")